What do you mean by compiling a textfile and outputing a binary file?
: :
: : Are you talking about compiling source code contained in the textfile? making the text in the file into a binary file?
: :
: :
: yes, compiling the ascii mov command into hex 0B8h. The text file is ascii character source code and the output would be a binary file.
:

The assembler makes those binary files, though. What are you asking me to change or do?


To go on a tangent about assembling the mov instruction,
there are several machine codes for the mov instruction. Different machine code for different types of operands.

Here is how the mov reg16,i16 instruction is done:
10111+r16 + i16

r16 would be defining the 16-bit register.
values:
000 ax
001 cx
010 dx
011 bx
100 sp
101 bp
110 si
111 di

i16 would be a word(little endian format, low order byte just after the register, high order byte at the end of machine code)

for example,

mov ax,3Fh

assembles to:

'10111'+'000'+(3Fh in binary)+(00h in binary)

= '10111'+'000'+'00111111'+'00000000'

= '101110000011111100000000' in binary

= 'B83F00' in hex

This would be converted to byte values in the binary or program file.

101110000001001100000000
CD 10

Function-wise, there is no difference between the HEX and the disassembled ASM code.
Mneumonics (the stuff you write to make an ASM program before you assemble/compile it) are just there to make life a little easier for you. If you wanted to, you could write all your programs with HEX! no joke!
Look at this ASM command:
Int 21h

(the h means it's a hex number. that's 21 HEX, which you know in decimal as 33)
when you compile that command, then look at its hex equivalent, it looks like this:
CD21

I picked this one because for alot of the ints it's straight forward. an int command takes 2 bytes: CD first specifies that this command is the INT command. The next byte is the interrupt #. So, INT 22h would be, suprise suprise, CD22.

Another example.. with These commands:
INC AX
INC CX
INC BX
INC DX

you could type them in in hex:
40h (this is inc AX)
41h (this is inc CX)
42h (this is inc BX)
43h (this is inc DX)


The point is, the hex is how it's actually stored on the computer. It's really quite complicated, I just chose some simple examples, but it would be possible to program using just numbers: meaning, you could code in HEX, Decimal... Why, if you know how this numeric encoding works, you can even write programs just by using a text editor and special characters - no assembling or compiling program needed!!
If you don't beleive me, look for a tutorial on this site called "Programming in extreme conditions"... or something like that.


: wats the difference between hex decoder and disassembler ?
:
: i tried disassembling (or hex decoding ... i dont know) a program and all i saw was the hex language when i disassembled it and some addresses on the left side ?
:
: wat xactly is this ? is this an HEX version of the target program running in main memory ?
:
